package com.pinyoumei.app.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.pinyoumei.app.R;
import com.pinyoumei.app.bean.ShopCenterMainBean;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2020-12-09.
 * --------- 日期 ------- 维护人 ------------ 变更内容 --------
 * 2020-12-09        Administrator             新增Person类
 * 2020-12-09        Administrator             增加sex属性
 */
public class ShopItemAdapter extends BaseQuickAdapter<ShopCenterMainBean.ResultBean.ChildBean, BaseViewHolder> {



    public ShopItemAdapter(int layoutResId, @Nullable List<ShopCenterMainBean.ResultBean.ChildBean> data) {
        super(layoutResId, data);


    }


    @Override
    protected void convert(BaseViewHolder helper, ShopCenterMainBean.ResultBean.ChildBean item) {


        RequestOptions placeholder = new RequestOptions().placeholder(R.mipmap.ic_error_loading);
        ImageView imageView = helper.getView(R.id.iv_bg);
        Glide.with(mContext).load(item.getIcon()+"").apply(placeholder).into(imageView);

        helper.setText(R.id.tv_name,item.getName());
    }
}
